/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import javafx.scene.text.Text;
import model.Model;
import javafx.scene.Group;

/**
 * @author Chris
 */
public class CharacterDisplay extends IDisplay {

    var model: Model;
    var group: Group;

    public override function setModel(modelP: Model) {
        this.model = modelP;
    }

    public override function getGroup(): Group {
        if (model != null) {
            if (group == null) {
                initComponents();
                group = Group {
                            content: [
                                textCharName,
                                textClassName
                            ]
                        };
                return group;
            } else {
                return group;
            }
        } else {
            return null;
        }

    }

    //KOMPONENTEN
    var textCharName: Text;
    var textClassName: Text;

    function initComponents(): Void {

        textCharName = Text {
                    x: 100;
                    y: 75;
                    content: bind model.getCharName();
                };
        textClassName = Text {
                    x: 100;
                    y: 50;
                    content: bind model.getCharClass();
                }
    }

}
